package com.niiwoo.civet.trade.dao.mapper.credit;

import com.niiwoo.civet.trade.dao.entity.credit.CreditProject;
import com.niiwoo.civet.trade.dto.request.loan.credit.INeedGuaranteeRequestDTO;

import java.util.List;

import com.niiwoo.civet.trade.dto.response.MyCreditLoanResponseDTO;
import org.apache.ibatis.annotations.Param;

import com.niiwoo.civet.trade.dao.entity.credit.CreditProjectGuarantee;
public interface CreditProjectMapperExt extends CreditProjectMapper {

    /**
     * 分页查询 我要担保列表
     * @param iNeedGuaranteeRequestDTO 我要担保列表请求DTO
     * @return 我担保的项目列表，父状态3：还款中，子状态300(正常还款中),301（逾期还款中）
     */
    List<CreditProject> pageINeedGuarantee(INeedGuaranteeRequestDTO iNeedGuaranteeRequestDTO);

    /**
     * 我要担保列表总数
     * @param iNeedGuaranteeRequestDTO 我要担保列表请求DTO
     * @return 总数
     */
    int countINeedGuarantee(INeedGuaranteeRequestDTO iNeedGuaranteeRequestDTO);

    /**
     *我的借款总数.
     * @param userId
     * @return
     */
    int selectMyCreditloanCount(String userId);


    /**
     * 我的借款列表.
     * @param userId
     * @return
     */
    List<MyCreditLoanResponseDTO> selectMyCreditloan(@Param("userId") String userId);

    List<CreditProject> queryCreditLoanGuaranteProjects(@Param("creditProjectGuarantees") List<CreditProjectGuarantee> creditProjectGuarantees);
    
	/**
	 * 根据项目ID查询
	 * 
	 * @param projectIdList
	 * @return
	 */
	List<CreditProject> selectByProjectIdList(@Param("projectIdList") List<Long> projectIdList);

    /**
     * @Title: queryLoanProjectByUserIdAndContractNo
     * @Description: 通过合同编号和用户编号查询项目
     * @param userId
     *            用户编号
     * @param projectId
     *            合同编号
     * @return ProjectWithBLOBs 返回类型
     */
    CreditProject selectProjectByUserIdAndProjectId(@Param("userId") String userId,
                                               @Param("projectId") Long projectId);
}